// const webpack = require("webpack");

module.exports = {
  productionSourceMap: false,
  lintOnSave: false,
  devServer: {
    port: 8103,
    overlay: {
      warning: false,
      errors: false
    },
    //在DevServer第一次构建完成时，是否自动打开浏览器
    open: true,
    //代理信息
    proxy: {
      //匹配的路径
      '/api': {
        //代理的路径
        target: 'http://localhost:8101',
        //是否开启跨域
        changeOrigin: true,
        //路径重写
        pathRewrite: {
          // '^/api': ''
        }
      },
      '/authorizationapi': {
        //代理的路径
        target: 'http://localhost:8102',
        //是否开启跨域
        changeOrigin: true,
        //路径重写
        pathRewrite: {
          //'^/authorizationapi': '/api'
        }
      },
      '/FileResource': {
        //代理的路径
        target: "http://localhost:8100",
        //是否开启跨域
        changeOrigin: true,
        //路径重写
        pathRewrite: {
          // '^/authorizationapi': '/api'
        }
      }
    }
  },
  css: {
    //查看CSS属于哪个css文件
    sourceMap: true
  },
  chainWebpack: (config) => {
    // 移除 prefetch 插件
    config.plugins.delete('prefetch');
    //自下定义title
    config.plugin('html').tap((args) => {
      args[0].title = 'KSO3.0版本';
      return args;
    });

  }
};